package com.xuerhua.yxt.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xuerhua.yxt.dao.GroupInfoMapper;
import com.xuerhua.yxt.model.GroupInfo;
import com.xuerhua.yxt.reqVo.BaseQueryVO;
import com.xuerhua.yxt.service.IGroupInfoService;

@Service("groupInfoService")
public class GroupInfoServiceImpl implements IGroupInfoService {

	@Autowired
	private GroupInfoMapper groupInfoMapper;
	
	@Override
	public int insertSelective(GroupInfo record) {
		return groupInfoMapper.insertSelective(record);
	}

	@Override
	public GroupInfo selectByPrimaryKey(Integer id) {
		return groupInfoMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(GroupInfo record) {
		return groupInfoMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public List<GroupInfo> selectList(BaseQueryVO vo) {
		return groupInfoMapper.selectList(vo);
	}

	@Override
	public int addUpdate(GroupInfo record) {
		if(record.getId() != null) {
			record.setUpdateTime(new Date());
			return groupInfoMapper.updateByPrimaryKeySelective(record);
		}
		return groupInfoMapper.insertSelective(record);
	}

}
